/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2204 - Arr2
 * <p>Powered by webrx On 2022-09-06 11:18:19
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr2 {
    public static void main(String[] args) {
        //引用类型（对象类型)
        int[] ns = new int[5];
        System.out.println(ns[4]);//0

        //int[] aa = ns;
        int[] aa = ns.clone(); //克隆对象，重新分配地址
        System.out.println(aa == ns); //true 是一个对象

        System.out.println(aa[4]);//0

        aa[4] = 400;
        System.out.println(aa[4]);//400
        System.out.println(ns[4]);//400

        //引用类型，引用的是对象的地址，
        System.out.println(ns);
        System.out.println(aa);



        //基本类型
        int a = 10;

        int b = a;
        b = 200;
        System.out.println(a);
        System.out.println(b);

    }
}
